package com.ruoyi.course.service.impl;

import java.util.List;
import com.ruoyi.common.utils.DateUtils;
import org.springframework.beans.factory.annotation.Autowired;
import org.springframework.stereotype.Service;
import com.ruoyi.course.mapper.TVideoCategoryMapper;
import com.ruoyi.course.domain.TVideoCategory;
import com.ruoyi.course.service.ITVideoCategoryService;

/**
 * 视频分类Service业务层处理
 *
 * @author ruoyi
 * @date 2024-11-30
 */
@Service
public class TVideoCategoryServiceImpl implements ITVideoCategoryService
{
    @Autowired
    private TVideoCategoryMapper tVideoCategoryMapper;

    /**
     * 查询视频分类
     *
     * @param id 视频分类主键
     * @return 视频分类
     */
    @Override
    public TVideoCategory selectTVideoCategoryById(Long id)
    {
        return tVideoCategoryMapper.selectTVideoCategoryById(id);
    }

    /**
     * 查询视频分类列表
     *
     * @param tVideoCategory 视频分类
     * @return 视频分类
     */
    @Override
    public List<TVideoCategory> selectTVideoCategoryList(TVideoCategory tVideoCategory)
    {
        return tVideoCategoryMapper.selectTVideoCategoryList(tVideoCategory);
    }

    /**
     * 新增视频分类
     *
     * @param tVideoCategory 视频分类
     * @return 结果
     */
    @Override
    public int insertTVideoCategory(TVideoCategory tVideoCategory)
    {
        tVideoCategory.setCreateTime(DateUtils.getNowDate());
        return tVideoCategoryMapper.insertTVideoCategory(tVideoCategory);
    }

    /**
     * 修改视频分类
     *
     * @param tVideoCategory 视频分类
     * @return 结果
     */
    @Override
    public int updateTVideoCategory(TVideoCategory tVideoCategory)
    {
        tVideoCategory.setUpdateTime(DateUtils.getNowDate());
        return tVideoCategoryMapper.updateTVideoCategory(tVideoCategory);
    }

    /**
     * 批量删除视频分类
     *
     * @param ids 需要删除的视频分类主键
     * @return 结果
     */
    @Override
    public int deleteTVideoCategoryByIds(Long[] ids)
    {
        return tVideoCategoryMapper.deleteTVideoCategoryByIds(ids);
    }

    /**
     * 删除视频分类信息
     *
     * @param id 视频分类主键
     * @return 结果
     */
    @Override
    public int deleteTVideoCategoryById(Long id)
    {
        return tVideoCategoryMapper.deleteTVideoCategoryById(id);
    }
}

